home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / io / FileNotFoundException.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.2 KB  |  72 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)FileNotFoundException.java    1.16 98/09/02
  3.  *
  4.  * Copyright 1994-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17.  
  18. /**
  19.  * Signals that an attempt to open the file denoted by a specified pathname
  20.  * has failed.
  21.  *
  22.  * <p> This exception will be thrown by the {@link FileInputStream}, {@link
  23.  * FileOutputStream}, and {@link RandomAccessFile} constructors when a file
  24.  * with the specified pathname does not exist.  It will also be thrown by these
  25.  * constructors if the file does exist but for some reason is inaccessible, for
  26.  * example when an attempt is made to open a read-only file for writing.
  27.  *
  28.  * @author  unascribed
  29.  * @version 1.16, 09/02/98
  30.  * @since   JDK1.0
  31.  */
  32.  
  33. public class FileNotFoundException extends IOException {
  34.  
  35.     /**
  36.      * Constructs a <code>FileNotFoundException</code> with
  37.      * <code>null</code> as its error detail message.
  38.      */
  39.     public FileNotFoundException() {
  40.     super();
  41.     }
  42.  
  43.     /**
  44.      * Constructs a <code>FileNotFoundException</code> with the
  45.      * specified detail message. The string <code>s</code> can be
  46.      * retrieved later by the
  47.      * <code>{@link java.lang.Throwable#getMessage}</code>
  48.      * method of class <code>java.lang.Throwable</code>.
  49.      *
  50.      * @param   s   the detail message.
  51.      */
  52.     public FileNotFoundException(String s) {
  53.     super(s);
  54.     }
  55.  
  56.     /**
  57.      * Constructs a <code>FileNotFoundException</code> with a detail message
  58.      * consisting of the given pathname string followed by the given reason
  59.      * string.  If the <code>reason</code> argument is <code>null</code> then
  60.      * it will be omitted.  This private constructor is invoked only by native
  61.      * I/O methods.
  62.      *
  63.      * @since JDK1.2
  64.      */
  65.     private FileNotFoundException(String path, String reason) {
  66.     super(path + ((reason == null)
  67.               ? ""
  68.               : " (" + reason + ")"));
  69.     }
  70.  
  71. }
  72.